﻿<%@ Page Title="" Language="C#" MasterPageFile="~/PBOfficeMaster.master" AutoEventWireup="true"
    CodeFile="AddMessage.aspx.cs" Inherits="Message_AddMessage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <style type="text/css">
        #content
        {
            width: 857px;
            height: auto;
        }
        .btnBranch
        {
            width: auto;
            height: 20px;
            background-color: #ccffff;
            border: 1px solid #000099;
            color: #000099;
        }
        .txt
        {
            border: 1px solid #6699ff;
            color: Blue;
        }
        #content table tr td
        {
            text-align: left;
            line-height: 30px;
        }
        .style1
        {
            width: 580px;
        }
        .style2
        {
            width: 180px;
        }
        .sou
        {
            width: 500px;
            margin-left: 50px;
        }
        .sou ul li
        {
            text-align: left;
        }
    </style>
    <script type="text/javascript">
        function OpenTree(width, height) {
            var me;
            // 把父页面窗口对象当作参数传递到对话框中，以便对话框操纵父页自动刷新。 
            me = window;
            // 显示对话框。 
            var a = window.showModalDialog("Tree.aspx", me, 'dialogWidth=' + width + 'px;dialogHeight=' + height + 'px;toolbar=0;scrollbars=0;location=0;status=0;menubar=0;resize=0;help:no;status:no')
            if (typeof (a) != "undefined")

            //返回值赋给TextBox
                window.document.getElementById("txtDept").value = a;
            alert(a);
        } 
        function selectAll(rbAll) {
            var sou = document.getElementById("sou");
            var ren = document.getElementById("ren");
            if (rbAll.checked == true) {
                sou.style.display = "none";
                ren.style.display = "none";

            }
        }
        function About(select) {
            var sou = document.getElementById("sou");
            var ren = document.getElementById("ren");
            if (select.checked == true) {
                sou.style.display = "";
                ren.style.display = "";

            }
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div style="width: 864px; height: auto; font-size: 14px;">
        <fieldset style="width: 851px; margin: 2px 2px; padding: 0; border: 1px solid #ccc;">
            <legend>消息填写区</legend>
            <div id="content">
                <table>
                    <tr>
                        <td style="font-weight: bold;" class="style2">
                            消息标题：
                        </td>
                        <td class="style1">
                            <asp:TextBox ID="txtTitle" CssClass="txt" runat="server"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td class="style2">
                            消息类型：
                        </td>
                        <td class="style1">
                            <asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="SqlDataSource1"
                                DataTextField="MessageTypeName" DataValueField="MessageTypeId">
                            </asp:DropDownList>
                            <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:OAConnectionString %>"
                                SelectCommand="SELECT * FROM [MessageType]"></asp:SqlDataSource>
                        </td>
                    </tr>
                    <tr>
                        <td class="style2">
                            开始有效时间：
                        </td>
                        <td class="style1">
                            <asp:TextBox ID="txtBeginTime" CssClass="txt" runat="server"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td class="style2">
                            结束有效时间：
                        </td>
                        <td class="style1">
                            <asp:TextBox ID="txtEndTime" CssClass="txt" runat="server"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td class="style2">
                            发送对象：
                        </td>
                        <td class="style1">
                            <input id="rbAll" type="radio" runat="server" name="ren" onclick="selectAll(this);" />所有人
                            <input id="rbSelect" type="radio" runat="server" name="ren" onclick="About(this);" />选择特定对象
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" style="text-align: center;">
                            <div id="sou" class="sou">
                                <fieldset style="width: 500px; border: 1px solid #ccc;">
                                    <legend>
                                        <asp:Image ID="Image1" runat="server" ImageUrl="~/imges/fangda.jpg" />搜索范围</legend>
                                    <ul>
                                        <li>
                                            <asp:CheckBox ID="cbDept" runat="server" Text="按部门" OnCheckedChanged="cbDept_CheckedChanged"
                                                AutoPostBack="True" />
                                            <asp:CheckBox ID="cbStfNo" runat="server" Text="按员工号" OnCheckedChanged="cbStfNo_CheckedChanged"
                                                AutoPostBack="True" /><asp:CheckBox ID="cbName" runat="server" Text="按姓名" /></li>
                                        <li>部门：<asp:TextBox ID="txtDept" CssClass="txt" runat="server"></asp:TextBox></li>
                                        <li>员工号：<asp:TextBox ID="txtStfNo" CssClass="txt" runat="server"></asp:TextBox>
                                        姓名：<asp:TextBox ID="txtName" runat="server" CssClass="txt"></asp:TextBox></li>
                                        <li>(模糊查询eg:李)</li>
                                        <li>
                                            <asp:Button ID="Button3" runat="server" CssClass="btnBranch" Text="确定选择范围" OnClick="Button3_Click" /></li>
                                    </ul>
                                </fieldset>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" style="text-align: center;">
                            <div id="ren" style="width: 500px; margin-top: 15px; margin-left: 50px;">
                                <fieldset style="border: 1px solid #ccc;">
                                    <legend>请选择发送对象</legend>
                                    <div style="float: left; height: 60px;">
                                        <div style="width: 107px; float: left; border: 1px solid #ccc; height: 41px;">
                                            <asp:CheckBox ID="cbAll" runat="server" Text="全选" /></div>
                                        <div>
                                            <asp:CheckBoxList ID="cbList" runat="server" RepeatColumns="4" RepeatDirection="Horizontal">
                                            </asp:CheckBoxList>
                                        </div>
                                    </div>
                                </fieldset>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td style="font-weight: bold;" class="style2">
                            消息内容：
                        </td>
                        <td class="style1">
                            <asp:TextBox ID="txtContent" runat="server" CssClass="txt" TextMode="MultiLine" Height="151px"
                                Width="572px"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td class="style2">
                        </td>
                        <td class="style1">
                            <asp:Button ID="btnSave" runat="server" CssClass="btnBranch" Text="保存消息" OnClick="btnSave_Click" />&nbsp;&nbsp;&nbsp;
                            <asp:Button ID="btnReturn" runat="server" CssClass="btnBranch" Text="返回" />
                        </td>
                    </tr>
                </table>
            </div>
        </fieldset>
    </div>
</asp:Content>
